//导入request.js请求工具
import request from '../../utils/request.js'

/**
 
 * 登录接口
 */ 
export const userLoginService = (loginData) => {
  // 后端接口需要JSON格式的请求体
  return request.post('/auth/login', {
    username: loginData.username,
    password: loginData.password
  }, {
    headers: {
      'Content-Type': 'application/json'
    }
  });
};

/**
 * 
 * @returns 获取用户权限信息
 */
export const getUserPermissionService = () => {
  return request.get('/user/info');
}

/**
 * 获取用户详细信息
 */
export const getUserInfoService = () => {
  return request.get('/user/details');
}